package com.guomw.report.service.service.impl;

import com.guomw.report.service.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

@Service
public class ConfigServiceImpl implements ConfigService {

    @Autowired
    private Environment env;

    @Override

    public String getChainServerUrl() {
        return env.getProperty("ChainServerUrl", "http://test.bxsbio.com/api/");//"http://localhost:8003/api/"
    }

    @Override
    public String getResourcesUri() {
        return env.getProperty("resourcesUri", "http://localhost:8080/resource");
    }

    @Override
    public String getResourcesHome() {
        return env.getProperty("resourcesHome", "D:\\javas\\report-manage\\web\\target\\ROOT\\resource");
    }

    /**
     * 检测文件目录
     * @return
     */
//    @Override
//    public String getCheckedFolder() {
//        return env.getProperty("CheckedFolder", "D:\\uploads\\checked");//"http://localhost:8003/api/"
//    }
//
//    /**
//     * 上链文件目录
//     * @return
//     */
//    @Override
//    public String getChainFolder() {
//        return env.getProperty("ChainFolder", "D:\\uploads\\chain");//"http://localhost:8003/api/"
//    }

    /**
     * 报表文件目录
     * @return
     */
    @Override
    public String getReportFileFolder() {
        return env.getProperty("ReportFileFolder", "D:\\javas\\report-manage\\web\\target\\ROOT\\resource\\report");//"http://localhost:8003/api/"
    }

    @Override
    public String getWkHtmlToPdfFolder() {
        return env.getProperty("WkHtmlToPdfFolder", "C:\\Program Files\\wkhtmltopdf\\bin\\");
    }

    @Override
    public String webUrl (){
        return env.getProperty("WebUrl", "http://localhost:8080");
    }
}
